/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package py.com.peluq.model.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Diego_M
 */
@Entity
@Table(name = "servicios", catalog = "peludb", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Servicios.findAll", query = "SELECT s FROM Servicios s"),
    @NamedQuery(name = "Servicios.findBySerCod", query = "SELECT s FROM Servicios s WHERE s.serCod = :serCod"),
    @NamedQuery(name = "Servicios.findByFecha", query = "SELECT s FROM Servicios s WHERE s.fecha = :fecha"),
    @NamedQuery(name = "Servicios.findByMonto", query = "SELECT s FROM Servicios s WHERE s.monto = :monto")})
public class Servicios implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "ser_cod", nullable = false)
    private Integer serCod;
    @Column(name = "fecha")
    private Integer fecha;
    @Column(name = "monto")
    private Integer monto;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "servicios")
    private Collection<Facxservicios> facxserviciosCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "servicios")
    private Collection<ServiciosDet> serviciosDetCollection;
    @JoinColumns({
        @JoinColumn(name = "cli_cod", referencedColumnName = "cli_cod"),
        @JoinColumn(name = "ci_emp", referencedColumnName = "ci_emp", nullable = false),
        @JoinColumn(name = "re_cob", referencedColumnName = "re_cob", nullable = false)})
    @ManyToOne(optional = false)
    private ReservaTurno reservaTurno;

    public Servicios() {
    }

    public Servicios(Integer serCod) {
        this.serCod = serCod;
    }

    public Integer getSerCod() {
        return serCod;
    }

    public void setSerCod(Integer serCod) {
        this.serCod = serCod;
    }

    public Integer getFecha() {
        return fecha;
    }

    public void setFecha(Integer fecha) {
        this.fecha = fecha;
    }

    public Integer getMonto() {
        return monto;
    }

    public void setMonto(Integer monto) {
        this.monto = monto;
    }

    @XmlTransient
    public Collection<Facxservicios> getFacxserviciosCollection() {
        return facxserviciosCollection;
    }

    public void setFacxserviciosCollection(Collection<Facxservicios> facxserviciosCollection) {
        this.facxserviciosCollection = facxserviciosCollection;
    }

    @XmlTransient
    public Collection<ServiciosDet> getServiciosDetCollection() {
        return serviciosDetCollection;
    }

    public void setServiciosDetCollection(Collection<ServiciosDet> serviciosDetCollection) {
        this.serviciosDetCollection = serviciosDetCollection;
    }

    public ReservaTurno getReservaTurno() {
        return reservaTurno;
    }

    public void setReservaTurno(ReservaTurno reservaTurno) {
        this.reservaTurno = reservaTurno;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (serCod != null ? serCod.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Servicios)) {
            return false;
        }
        Servicios other = (Servicios) object;
        if ((this.serCod == null && other.serCod != null) || (this.serCod != null && !this.serCod.equals(other.serCod))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.com.peluq.model.entity.Servicios[ serCod=" + serCod + " ]";
    }
    
}
